﻿<UserControl x:Class="TecX.Agile.Views.StoryCardView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:Converters="clr-namespace:TecX.Agile.Infrastructure.Converters;assembly=TecX.Agile.Infrastructure"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:Behaviors="clr-namespace:TecX.Agile.Behaviors" 
             xmlns:cal="http://www.caliburnproject.org"
             xmlns:DesignerSupport="clr-namespace:TecX.Agile.DesignerSupport" mc:Ignorable="d" 
             x:Name="StoryCard"    
	         d:DesignWidth="300"
             d:DesignHeight="200"
             d:DataContext="{d:DesignInstance DesignerSupport:DesignStoryCardViewModel, IsDesignTimeCreatable=True}"
             BorderBrush="Black"
             BorderThickness="1"
             cal:Bind.Model="{Binding}"
             Height="{Binding Height}"
             Opacity="{Binding Opacity}">
    <UserControl.Resources>
        <Converters:ColorToSolidColorBrushConverter x:Key="ColorToBrushConverter" />
    </UserControl.Resources>
    <UserControl.Background>
        <Binding Path="Background" Converter="{StaticResource ColorToBrushConverter}"/>
    </UserControl.Background>
    <i:Interaction.Behaviors>
        <Behaviors:RntBehavior/>
        <!--<Behaviors:MultiTouchBehavior/>-->
        <Behaviors:TransformBehavior/>
    </i:Interaction.Behaviors>
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="1*" MinHeight="25"/>
            <RowDefinition Height="1*"/>
            <RowDefinition Height="6*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <TextBox
                    x:Name="Title" 
                    Style="{StaticResource HiddenTextBoxStyle}"
                    Grid.ColumnSpan="6" />
        <TextBox 
            x:Name="MostLikelyEstimate"
            MinWidth="40" 
            Style="{StaticResource HiddenTextBoxStyle}"
            Grid.Row="1" 
            Grid.Column="1">
            <i:Interaction.Behaviors>
                <Behaviors:HighlightFieldBehavior/>
            </i:Interaction.Behaviors>
        </TextBox>
        <TextBox 
            x:Name="ActualEffort" 
            MinWidth="40" 
            Style="{StaticResource HiddenTextBoxStyle}"
            Grid.Row="1" 
            Grid.Column="3">
            <i:Interaction.Behaviors>
                <Behaviors:HighlightFieldBehavior/>
            </i:Interaction.Behaviors>
        </TextBox>
        <TextBox 
            x:Name="TaskOwner" 
            MinWidth="60" 
            Style="{StaticResource HiddenTextBoxStyle}"
            Grid.Row="1" 
            Grid.Column="5">
            <i:Interaction.Behaviors>
                <Behaviors:HighlightFieldBehavior/>
            </i:Interaction.Behaviors>
        </TextBox>
        <TextBox 
            x:Name="Description" 
            MinHeight="150" 
            Style="{StaticResource HiddenTextBoxStyle}"
            TextWrapping="Wrap" 
            Grid.Row="2" 
            Grid.ColumnSpan="6" 
            VerticalContentAlignment="Top"
            AcceptsReturn="True" 
            AllowDrop="False">
            <i:Interaction.Behaviors>
                <Behaviors:HighlightFieldBehavior/>
            </i:Interaction.Behaviors>
        </TextBox>
        <Label 
            Content="Mostlikely:" 
            Grid.Row="1"
            VerticalContentAlignment="Center" />
        <Label
            Content="Actual:" 
            Grid.Row="1" 
            Grid.Column="2"
            VerticalContentAlignment="Center" />
        <Label
            Content="Owner:" 
            Grid.Row="1" 
            Grid.Column="4"
            VerticalContentAlignment="Center" />
        <Grid 
            x:Name="Overlay" 
            Grid.RowSpan="3" 
            Grid.ColumnSpan="6" 
            IsHitTestVisible="False" 
            Panel.ZIndex="50">
            <Rectangle Style="{StaticResource TopSeparator}"  Margin="0,25,0,0"/>
            <Rectangle Style="{StaticResource Separator}" Margin="0,50,0,0" />
            <Rectangle Style="{StaticResource Separator}" Margin="0,75,0,0" />
            <Rectangle Style="{StaticResource Separator}" Margin="0,100,0,0" />
            <Rectangle Style="{StaticResource Separator}" Margin="0,125,0,0" />
            <Rectangle Style="{StaticResource Separator}" Margin="0,150,0,0" />
            <Rectangle Style="{StaticResource Separator}" Margin="0,175,0,0" />
        </Grid>
        <InkCanvas            
            x:Name="DescriptionHandwritingImage" 
            Grid.Row="2" 
            Grid.ColumnSpan="6" 
            IsHitTestVisible="{Binding IsHandWritingEnabled}" 
            Background="Transparent"/>
        <ItemsControl 
            IsHitTestVisible="False"
            ItemsSource="{Binding Decorators}"
            Grid.ColumnSpan="6" 
            Grid.RowSpan="3">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
        </ItemsControl>
    </Grid>
</UserControl>
